<?php


namespace app\service;


use yii\web\Session;

class SessionStorage implements StorageInterface
{
    private $session;
    private $key;
    public function __construct(Session $session, $key)
    {
        $this->key = $key;
        $this->session = $session;
    }

    public function load()
    {
        // TODO: Implement load() method.
        return $this->session->get($this->key, []);
    }

    public function save(array $items)
    {
        // TODO: Implement save() method.
        return $this->session->get($this->key, $items);
    }
}